package x.ovo.wechat.bot.common.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 异步消息更新类型
 *
 * @author ovo, created by 2024/04/21
 */
@Getter
@RequiredArgsConstructor
public enum SyncCheckSelector {
    NORMAL(0, "正常"),
    NEW_MSG(2, "有新消息"),
    MOD_CONTACT(4, "昵称修改或备注"),
    ADD_OR_DEL_CONTACT(6, "删除或者新增的好友信息"),
    ENTER_OR_LEAVE_CHAT(7, "进入或离开聊天界面");

    private final int code;
    private final String message;

    public static SyncCheckSelector get(int code) {
        for (SyncCheckSelector value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        return NORMAL;
    }
}
